package com.t5;

/**
 * Created by xuyiwei on 2018/7/14.
 */
class Book{
    boolean checkOut = false;

    Book(boolean checkOut){
        this.checkOut = checkOut;
    }

    void checkIn(){
        this.checkOut = false;
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        System.out.println("抛出异常");
    }
}


public class TerminationCondition {
    public static void main(String[] args) {
        Book novel = new Book(true);
        novel.checkIn();

        //有指针指向 因此清理的时候是清理不到的
        Book novelZ = new Book(true);

        System.gc();
    }
}
